how to get all objects between two column from a javascript array